<template>
	<view class="carPage">

		<view class="roomList">
			<view class="room" v-for="r in carList" :key="r.id">
				<view>
					<image class="roomCover" mode="aspectFill" :src="r.photo"></image>
				</view>
				<view style="width: calc(100% - 180rpx);">
					<view class="name"> 两素一荤 <text class="price">¥30</text></view>
					<view class="flexinline">午餐</view>
					<view class="flexinline">
						配送时间：08:00 - 22:00
					</view>
					<view class="flexinline">
						配送地址： xxxx
					</view>
					<view class="po">
						<uni-number-box @change="changecarNum" :min="0" value="0" :max="10">
						</uni-number-box>
					</view>
				</view>
			</view>
		</view>

		<view class="bbfix">
			<!-- 底部提交 -->
			<view class="price">
				总价：
				<text>￥{{ money }}</text>
			</view>
			<view class="subBtn" @click="submit"> 选好了 </view>
		</view>
	</view>
</template>

<script setup>
	import {
		reactive,
		toRefs,
		getCurrentInstance
	} from 'vue';
	import * as hotel from '@/common/hotel.js';
	import {
		onShow,
		onShareAppMessage,
		onShareTimeline,
		onPullDownRefresh
	} from '@dcloudio/uni-app';
	import _ from 'lodash';
	const app = getApp();
	const {
		proxy
	} = getCurrentInstance();
	const data = reactive({
		range: [],
		carList: [1, 2, 3]
	});
	const {
		range,
		carList
	} = toRefs(data);
	onShow(option => {
		if (app.globalData.isLogin) {
			getList();
		} else {
			app.firstLoadCallback = () => {
				getList();
			};
		}
	})

	function getList() {

	}

	function submit() {
		let path = `/pages_hotel/eat/order`;
		uni.navigateTo({
			url: path
		});

	}
</script>

<style scoped lang="scss">
	.carPage {
		:deep(.uni-collapse-item) {
			margin: 0;
		}
	}

	.flexTop {
		display: flex;

		&>view {
			width: 50%;
			text-align: center;
		}

		.tt {
			color: #1EC886;
			font-size: 28rpx;
		}
	}

	.roomList {
		padding: 20rpx;background: #fff;
		box-sizing: border-box;
	}

	.room {
		display: flex;
		position: relative;
		padding: 15rpx 0 15px;
		border-bottom: 1px solid #DCDCDC;

		.name {
			font-size: 34rpx;
			width: 100%;

			text {
				float: right;
			}
		}

		.orange {
			font-size: 24rpx;
		}

		.po {
			position: absolute;
			right: 0;
			bottom: 15rpx;
			display: flex;
			align-items: flex-end;
		}

		.price {
			margin-right: 10rpx;
		}
	}

	.roomCover {
		width: 160rpx;
		margin-right: 20rpx;
		height: 170rpx;
		border-radius: 15rpx;
	}

	.price {
		display: flex;
		align-items: baseline;
		color: #1EC886;

		text {
			color: #1EC886;
			font-size: 55rpx;
		}
	}

	.flexinline {
		display: flex;
		font-size: 24rpx;
		color: #5E5E5E;
		width: 100%;

		text {
			margin-right: 15rpx;
		}
	}

	.bbfix {
		background: #fff;
		height: 150rpx;
		display: flex;
		position: fixed;
		z-index: 89;
		width: 100%;
		bottom: 0;
		align-items: baseline;
		justify-content: space-between;
		border-top: 1rpx solid #dcdcdc;

		.price {
			padding-left: 20rpx;

			text {
				font-weight: bold;
				font-size: 45rpx;
				color: #ff8124;
			}
		}

		.subBtn {
			font-size: 36rpx;
			color: #ffffff;
			background: #ff8124;
			height: 120rpx;
			line-height: 100rpx;
			padding: 0 30rpx;
		}
	}
</style>